package tma.sdcbatch11.foodordering;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

@SuppressLint("InflateParams")
public class TypeDishAdapter extends ArrayAdapter<Typedish>{
	private LayoutInflater inflater;

	public TypeDishAdapter(Context context, Typedish[] list) {
		super(context, 0, list);
		inflater = LayoutInflater.from(context);
		// TODO Auto-generated constructor stub
	}
	@SuppressLint("InflateParams")
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView == null){
			convertView = inflater.inflate(R.layout.list_type_dish, null);
		}
			
		TextView txtName =(TextView) convertView.findViewById(R.id.typelist_item);
		
		Typedish item = getItem(position);
		
		txtName.setText(item.getName());
		return convertView;
	}

}


